// 统一请求路径前缀在libs/axios.js中修改
import {
  getRequest,
  postRequest,
  putRequest,
  deleteRequest
} from "@/libs/axios";
/**
 * 添加会员
 * @param {*} params 
 * @returns 
 */
export const addMemberGrade = params => {
  return postRequest(`/member/memberGrade/add`, params);
};
/**
 * 获取会员等级分页
 * @param {*} params 
 * @returns 
 */
export const memberGradeList = params => {
  return getRequest(`/member/memberGrade/getByPage`, params);
};
/**
 * 删除会员等级
 * @param {*} params 
 * @returns 
 */
export const delMemberGrade = id => {
  return deleteRequest(`/member/memberGrade/delete/${id}`);
};
/**
 * PLUS会员列表
 * @param {*} params 
 * @returns 
 */
export const plusList = params => {
  let headers = { "Content-Type": "application/json" }
  return postRequest(`/user/plus/getByPage`, params, headers);
};
/**
 * 回显积分抵现
 */
export const creditForCash = () => {
  return getRequest(`/setting/setting/get/POINT_TO_DISCOUNT`)
}
/**
 * 保存积分抵现
 */
export const setCreditForCash = (params) => {
  return putRequest(`/setting/setting/put/POINT_TO_DISCOUNT`, params)
}
/**
 * plus权益设置
 */
export const setplus = (params) => {
  return putRequest(`/setting/setting/put/PLUS_SETTING`, params)
}
/**
 * plus权益设置列表
 */
export const getplusList = (params) => {
  return getRequest(`/setting/setting/get/PLUS_SETTING`, params)
}
/**
 * 获取店铺分页
 */
export const shopList = (params) => {
  return getRequest('/store/store', params)
}
/**
 * 修改保证金状态
 */
export const setBond=(id)=>{
  return putRequest(`/store/store/storeBond/${id}`)
}
/**
 * 查看保证金金额
 */
export const seeBondState=()=>{
  return getRequest(`/setting/setting/get/STORE_DEPOSIT`)
}
/**
 * 设置保证金金额
 */
export const setBondState=(params)=>{
  return putRequest(`/setting/setting/put/STORE_DEPOSIT`,params)
}
/**
 * plus会员详情
 */
export const plusDetail=(userId)=>{
  console.log(userId,'userId');
  return getRequest(`/user/plus/getInfo/${userId}`)
}